﻿using Enyim.Caching;
using System.Web.Mvc;
using SilenthinkContract;
using Web.Manage.Models;
using SilenthinkContract.Domain;

namespace Web.Manage.Controllers
{
    public class UserController : BaseController
    {
        public UserController(ILogService logService, IBaseService baseService, IExtraService extraService, IStoreService storeService, IOrderService orderService, IGameService gameService, IAuctionService auctionService, IPassportService passportService, IPaymentService paymentService, IMemcachedClient memcachedClient) : base(logService, baseService, extraService, storeService, orderService, gameService, auctionService, passportService, paymentService, memcachedClient)
        {
        }

        public ActionResult Index(string username = null, UserStatus? status = null, int page = 1, int size = 20)
        {
            var model = new UserControllerModel.Index();
            model.Status = status;
            model.UserName = username;
            model.Users = PassportService.GetPagedUser(username,status,page,size).ToPagedList(page, size);
            return PartialView(model);
        }

        public ActionResult Detail(long param)
        {
            var model = new UserControllerModel.Detail();
            model.User = PassportService.GetUser(param,true,true);
            return PartialView(model);
        }

        public ActionResult Order(OrderStatus?status = null, int page = 1, int size = 20)
        {
            var model = new UserControllerModel.Order();
           
            return PartialView(model);
        }
    }
}
